| for x in range(length): |
| result = runSQL("SELECT name,year_born FROM horrible_histories") |
| length = len(result) |
| n = str(n) |
| print("Year Born: " + n + "BC") |
| n = result[x][1] |
| else: |
| n = str(n) |
| print("Name: " + result[x][0]) |
| n = result[x][1] * -1 |
| print("Year Born: " + n) |
| if result[x][1] < 0: |
| print() |
| for x in range(length): |
| result = runSQL("SELECT name,year_born FROM horrible_histories") |
| length = len(result) |
|         n = str(n) |
|         print("Year Born: " + n + "BC") |
|         n = result[x][1] |
|     else: |
|         n = str(n) |
|     print("Name: " + result[x][0]) |
|         n = result[x][1] * -1 |
|         print("Year Born: " + n) |
|     if result[x][1] < 0: |
|     print() |
| 1 | result = runSQL("SELECT name,year_born FROM horrible_histories") |
| 2 | length = len(result) |
| 3 | for x in range(length): |
| 4 |     print("Name: " + result[x][0]) |
| 5 |     if result[x][1] < 0: |
| 6 |         n = result[x][1] * -1 |
| 7 |         n = str(n) |
| 8 |         print("Year Born: " + n + "BC") |
| 9 |     else: |
| 10 |         n = result[x][1] |
| 11 |         n = str(n) |
| 12 |         print("Year Born: " + n) |
| 13 |     print() |
| print("Heighest Value:") |
| print(maximum) |
| currentName = "" |
| currentName = result[x][0] |
| if result[x][1] > maximum: |
| print(currentName) |
| length = len(result) |
| for x in range(length): |
| maximum = result[x][1] |
| maximum = 0 |
| result = runSQL("SELECT name,year_born FROM horrible_histories") |
| print("Heighest Value:") |
| print(maximum) |
| currentName = "" |
|         currentName = result[x][0] |
|     if result[x][1] > maximum: |
| print(currentName) |
| length = len(result) |
| for x in range(length): |
|         maximum = result[x][1] |
| maximum = 0 |
| result = runSQL("SELECT name,year_born FROM horrible_histories") |
| 1 | result = runSQL("SELECT name,year_born FROM horrible_histories") |
| 2 | length = len(result) |
| 3 | maximum = 0 |
| 4 | currentName = "" |
| 5 | for x in range(length): |
| 6 |     if result[x][1] > maximum: |
| 7 |         maximum = result[x][1] |
| 8 |         currentName = result[x][0] |
| 9 | print("Heighest Value:") |
| 10 | print(currentName) |
| 11 | print(maximum) |
| print("Name: " + card[0]) |
| import random |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| print("Year Born: " + str(card[1])) |
| if card[1] < 0: |
| card = result[r] |
| print("Fame Factor: " + str(card[3])) |
| print("Age at Death: " + str(card[2])) |
| print("Dreadful Death: " + str(card[5])) |
| card[1] = card[1] * -1 |
| print("Despicable Deeds: " + str(card[4])) |
| r = random.randint(0,len(result)) |
| card[1] = str(card[1]) + "BC" |
| print("Name: " + card[0]) |
| import random |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| print("Year Born: " + str(card[1])) |
| if card[1] < 0: |
| card = result[r] |
| print("Fame Factor: " + str(card[3])) |
| print("Age at Death: " + str(card[2])) |
| print("Dreadful Death: " + str(card[5])) |
|   card[1] = card[1] * -1 |
| print("Despicable Deeds: " + str(card[4])) |
| r = random.randint(0,len(result)) |
|   card[1] = str(card[1]) + "BC" |
| 1 | import random |
| 2 | |
| 3 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| 4 | r = random.randint(0,len(result)) |
| 5 | card = result[r] |
| 6 | |
| 7 | if card[1] < 0: |
| 8 |   card[1] = card[1] * -1 |
| 9 |   card[1] = str(card[1]) + "BC" |
| 10 | |
| 11 | print("Name: " + card[0]) |
| 12 | print("Year Born: " + str(card[1])) |
| 13 | print("Age at Death: " + str(card[2])) |
| 14 | print("Fame Factor: " + str(card[3])) |
| 15 | print("Despicable Deeds: " + str(card[4])) |
| 16 | print("Dreadful Death: " + str(card[5])) |
| card = result[i] |
| print("Despicable Deeds: " + str(card[4])) |
| print("Pick a card between 1 and 30") |
| break |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| print("Year Born: " + str(card[1])) |
| card[1] = str(card[1]) + "BC" |
| i = int(i) |
| card[1] = card[1] * -1 |
| if card[1] < 0: |
| print("Dreadful Death: " + str(card[5])) |
| i = input() |
| if i.isdigit(): |
| if i > 0 and i < 31: |
| print("Age at Death: " + str(card[2])) |
| while True: |
| print("Fame Factor: " + str(card[3])) |
| print("Name: " + card[0]) |
| card = result[i] |
| print("Despicable Deeds: " + str(card[4])) |
|   print("Pick a card between 1 and 30") |
|       break |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| print("Year Born: " + str(card[1])) |
|   card[1] = str(card[1]) + "BC" |
|     i = int(i) |
|   card[1] = card[1] * -1 |
| if card[1] < 0: |
| print("Dreadful Death: " + str(card[5])) |
|   i = input() |
|   if i.isdigit(): |
|     if i > 0 and i < 31: |
| print("Age at Death: " + str(card[2])) |
| while True: |
| print("Fame Factor: " + str(card[3])) |
| print("Name: " + card[0]) |
| 1 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| 2 | while True: |
| 3 |   print("Pick a card between 1 and 30") |
| 4 |   i = input() |
| 5 |   if i.isdigit(): |
| 6 |     i = int(i) |
| 7 |     if i > 0 and i < 31: |
| 8 |       break |
| 9 | card = result[i] |
| 10 | |
| 11 | if card[1] < 0: |
| 12 |   card[1] = card[1] * -1 |
| 13 |   card[1] = str(card[1]) + "BC" |
| 14 | |
| 15 | print("Name: " + card[0]) |
| 16 | print("Year Born: " + str(card[1])) |
| 17 | print("Age at Death: " + str(card[2])) |
| 18 | print("Fame Factor: " + str(card[3])) |
| 19 | print("Despicable Deeds: " + str(card[4])) |
| 20 | print("Dreadful Death: " + str(card[5])) |
| print("Enter an age at death") |
| print(str(t) + " cards will beat this value") |
| t = len(result) |
| i = input() |
| result = runSQL("SELECT * FROM horrible_histories WHERE age_at_death > " + i) |
| 1 | print("Enter an age at death") |
| 2 | i = input() |
| 3 | result = runSQL("SELECT * FROM horrible_histories WHERE age_at_death > " + i) |
| 4 | t = len(result) |
| 5 | print(str(t) + " cards will beat this value") |
| print(str(x) + " " + str(t)) |
| result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
| t = len(result) |
| for x in range(21): |
|     print(str(x) + " " + str(t)) |
|     result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
|     t = len(result) |
| for x in range(21): |
| 1 | for x in range(21): |
| 2 |     result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
| 3 |     t = len(result) |
| 4 |     print(str(x) + " " + str(t)) |
| 5 |      |
| card = result[0] |
| print(results[x][0]) |
| print("See a list of all names in the deck:") |
| card[1] = str(card[1]) + "BC" |
| for x in range(len(results)): |
| nameList = [] |
| print("Fame Factor: " + str(card[3])) |
| card[1] = card[1] * -1 |
| print("Enter a name") |
| print("Despicable Deeds: " + str(card[4])) |
| n = input() |
| idx = nameList.index(n) |
| nameList.append(results[x][0]) |
| print("Name: " + card[0]) |
| print("Year Born: " + str(card[1])) |
| print("Age at Death: " + str(card[2])) |
| print("Dreadful Death: " + str(card[5])) |
| if card[1] < 0: |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
| results = runSQL("SELECT name FROM horrible_histories") |
| card = result[0] |
|   print(results[x][0]) |
| print("See a list of all names in the deck:") |
|   card[1] = str(card[1]) + "BC" |
| for x in range(len(results)): |
| nameList = [] |
| print("Fame Factor: " + str(card[3])) |
|   card[1] = card[1] * -1 |
| print("Enter a name") |
| print("Despicable Deeds: " + str(card[4])) |
| n = input() |
| idx = nameList.index(n) |
|   nameList.append(results[x][0]) |
| print("Name: " + card[0]) |
| print("Year Born: " + str(card[1])) |
| print("Age at Death: " + str(card[2])) |
| print("Dreadful Death: " + str(card[5])) |
| if card[1] < 0: |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
| results = runSQL("SELECT name FROM horrible_histories") |
| 1 | results = runSQL("SELECT name FROM horrible_histories") |
| 2 | print("See a list of all names in the deck:") |
| 3 | nameList = [] |
| 4 | for x in range(len(results)): |
| 5 |   nameList.append(results[x][0]) |
| 6 |   print(results[x][0]) |
| 7 | print("Enter a name") |
| 8 | n = input() |
| 9 | idx = nameList.index(n) |
| 10 | |
| 11 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
| 12 | card = result[0] |
| 13 | if card[1] < 0: |
| 14 |   card[1] = card[1] * -1 |
| 15 |   card[1] = str(card[1]) + "BC" |
| 16 | |
| 17 | print("Name: " + card[0]) |
| 18 | print("Year Born: " + str(card[1])) |
| 19 | print("Age at Death: " + str(card[2])) |
| 20 | print("Fame Factor: " + str(card[3])) |
| 21 | print("Despicable Deeds: " + str(card[4])) |
| 22 | print("Dreadful Death: " + str(card[5])) |
| print("Age at Death: " + str(card[7])) |
| print("Despicable Deeds: " + str(card[9])) |
| card[6] = card[6] * -1 |
| print("Dreadful Death: " + str(card[10])) |
| card[6] = str(card[6]) + "BC" |
| results = runSQL("SELECT * FROM horrible_histories") |
| print("------------------------------------") |
| print("------------------------------------") |
| r = random.randint(0,len(results)-1) |
| print("------------------------------------") |
| print("------------------------------------") |
| print(card[1]) |
| print(card[5]) |
| print("Fame Factor: " + str(card[8])) |
| print("Year Born: " + str(card[6])) |
| if card[6] < 0: |
| print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| card = results[r] |
| print("Age at Death: " + str(card[7])) |
| print("Despicable Deeds: " + str(card[9])) |
|   card[6] = card[6] * -1 |
| print("Dreadful Death: " + str(card[10])) |
|   card[6] = str(card[6]) + "BC" |
| results = runSQL("SELECT * FROM horrible_histories") |
| print("------------------------------------") |
| print("------------------------------------") |
| r = random.randint(0,len(results)-1) |
| print("------------------------------------") |
| print("------------------------------------") |
| print(card[1]) |
| print(card[5]) |
| print("Fame Factor: " + str(card[8])) |
| print("Year Born: " + str(card[6])) |
| if card[6] < 0: |
| print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| card = results[r] |
| 1 | results = runSQL("SELECT * FROM horrible_histories") |
| 2 | r = random.randint(0,len(results)-1) |
| 3 | card = results[r] |
| 4 | if card[6] < 0: |
| 5 |   card[6] = card[6] * -1 |
| 6 |   card[6] = str(card[6]) + "BC" |
| 7 | |
| 8 | print("------------------------------------") |
| 9 | print(card[1]) |
| 10 | print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| 11 | print("------------------------------------") |
| 12 | print(card[5]) |
| 13 | print("------------------------------------") |
| 14 | print("Year Born: " + str(card[6])) |
| 15 | print("Age at Death: " + str(card[7])) |
| 16 | print("Fame Factor: " + str(card[8])) |
| 17 | print("Despicable Deeds: " + str(card[9])) |
| 18 | print("Dreadful Death: " + str(card[10])) |
| 19 | print("------------------------------------") |
| start = lastspace |
| lastspace = x + 1 |
| print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
| card[6] = str(card[6]) + "BC" |
| print("|-----------------------------------------------------|") |
| desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
| for x in range(len(currDesc)): |
| if currDesc[x] == " ": |
| card = results[r] |
| results = runSQL("SELECT * FROM horrible_histories") |
| start = 0 |
| desc = "" |
| print("|-----------------------------------------------------|") |
| print("| " + title.ljust(52) + "|") |
| currentCount = currentCount + 1 |
| lastspace = 0 |
| title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
| print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
| currentCount = 0 |
| currDesc = card[5] |
| print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
| desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
| print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
| if card[6] < 0: |
| print(desc) |
| print("| " + card[1].ljust(52) + "|") |
| print("| ----------------------------------------------------|") |
| print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
| if currentCount == 40: |
| currentCount = 0 |
| r = random.randint(0,len(results)-1) |
| print("| ----------------------------------------------------|") |
| card[6] = card[6] * -1 |
|     start = lastspace |
|     lastspace = x + 1 |
| print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
|   card[6] = str(card[6]) + "BC" |
| print("|-----------------------------------------------------|") |
|     desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
| for x in range(len(currDesc)): |
|   if currDesc[x] == " ": |
| card = results[r] |
| results = runSQL("SELECT * FROM horrible_histories") |
| start = 0 |
| desc = "" |
| print("|-----------------------------------------------------|") |
| print("| " + title.ljust(52) + "|") |
|   currentCount = currentCount + 1 |
| lastspace = 0 |
| title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
| print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
| currentCount = 0 |
| currDesc = card[5] |
| print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
| desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
| print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
| if card[6] < 0: |
| print(desc) |
| print("| " + card[1].ljust(52) + "|") |
| print("| ----------------------------------------------------|") |
| print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
|   if currentCount == 40: |
|     currentCount = 0 |
| r = random.randint(0,len(results)-1) |
| print("| ----------------------------------------------------|") |
|   card[6] = card[6] * -1 |
| 1 | results = runSQL("SELECT * FROM horrible_histories") |
| 2 | r = random.randint(0,len(results)-1) |
| 3 | card = results[r] |
| 4 | if card[6] < 0: |
| 5 |   card[6] = card[6] * -1 |
| 6 |   card[6] = str(card[6]) + "BC" |
| 7 | |
| 8 | currDesc = card[5] |
| 9 | desc = "" |
| 10 | currentCount = 0 |
| 11 | lastspace = 0 |
| 12 | start = 0 |
| 13 | for x in range(len(currDesc)): |
| 14 |   if currDesc[x] == " ": |
| 15 |     lastspace = x + 1 |
| 16 |   currentCount = currentCount + 1 |
| 17 |   if currentCount == 40: |
| 18 |     desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
| 19 |     start = lastspace |
| 20 |     currentCount = 0 |
| 21 | desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
| 22 | print("|-----------------------------------------------------|") |
| 23 | print("| " + card[1].ljust(52) + "|") |
| 24 | title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
| 25 | print("| " + title.ljust(52) + "|") |
| 26 | print("| ----------------------------------------------------|") |
| 27 | print(desc) |
| 28 | print("| ----------------------------------------------------|") |
| 29 | print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
| 30 | print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
| 31 | print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
| 32 | print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
| 33 | print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
| 34 | print("|-----------------------------------------------------|") |
| card = results[r] |
| print(card[1]) |
| fameperc = round(len(fame)/29 * 100,1) |
| print(card[5]) |
| print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
| print("------------------------------------") |
| print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
| print("------------------------------------") |
| yearperc = round(len(year)/29 * 100,1) |
| print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
| results = runSQL("SELECT * FROM horrible_histories") |
| print("------------------------------------") |
| r = random.randint(0,len(results)-1) |
| year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
| print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
| print("------------------------------------") |
| death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
| age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
| card[6] = card[6] * -1 |
| card[6] = str(card[6]) + "BC" |
| ageperc = round(len(age)/29 * 100,1) |
| print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
| deathperc = round(len(death)/29 * 100,1) |
| if card[6] < 0: |
| fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
| print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| deedperc = round(len(deed)/29 * 100,1) |
| deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
| card = results[r] |
| print(card[1]) |
| fameperc = round(len(fame)/29 * 100,1) |
| print(card[5]) |
| print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
| print("------------------------------------") |
| print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
| print("------------------------------------") |
| yearperc = round(len(year)/29 * 100,1) |
| print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
| results = runSQL("SELECT * FROM horrible_histories") |
| print("------------------------------------") |
| r = random.randint(0,len(results)-1) |
| year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
| print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
| print("------------------------------------") |
| death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
| age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
|   card[6] = card[6] * -1 |
|   card[6] = str(card[6]) + "BC" |
| ageperc = round(len(age)/29 * 100,1) |
| print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
| deathperc = round(len(death)/29 * 100,1) |
| if card[6] < 0: |
| fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
| print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| deedperc = round(len(deed)/29 * 100,1) |
| deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
| 1 | results = runSQL("SELECT * FROM horrible_histories") |
| 2 | r = random.randint(0,len(results)-1) |
| 3 | card = results[r] |
| 4 | year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
| 5 | yearperc = round(len(year)/29 * 100,1) |
| 6 | age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
| 7 | ageperc = round(len(age)/29 * 100,1) |
| 8 | fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
| 9 | fameperc = round(len(fame)/29 * 100,1) |
| 10 | deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
| 11 | deedperc = round(len(deed)/29 * 100,1) |
| 12 | death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
| 13 | deathperc = round(len(death)/29 * 100,1) |
| 14 | |
| 15 | if card[6] < 0: |
| 16 |   card[6] = card[6] * -1 |
| 17 |   card[6] = str(card[6]) + "BC" |
| 18 | print("------------------------------------") |
| 19 | print(card[1]) |
| 20 | print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
| 21 | print("------------------------------------") |
| 22 | print(card[5]) |
| 23 | print("------------------------------------") |
| 24 | |
| 25 | print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
| 26 | print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
| 27 | print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
| 28 | print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
| 29 | print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
| 30 | print("------------------------------------") |
| r2 = random.randint(0.29) |
| row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| row = row + (rounds[x] + ": " + str(result[r2][x])) |
| print(row) |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| for x in range(len(rounds)): |
| rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
| r1 = random.randint(0,29) |
| r2 = random.randint(0.29) |
|     row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
|     row = row + (rounds[x] + ": " + str(result[r2][x])) |
|     print(row) |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| for x in range(len(rounds)): |
| rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
| r1 = random.randint(0,29) |
| 1 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| 2 | r1 = random.randint(0,29) |
| 3 | r2 = random.randint(0.29) |
| 4 | rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
| 5 | for x in range(len(rounds)): |
| 6 |     row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| 7 |     row = row + (rounds[x] + ": " + str(result[r2][x])) |
| 8 |     print(row) |
| 9 |      |
| for x in range(len(rounds)): |
| row += rounds[x] + ": " + str(result[r2][x]) |
| break |
| print("You win!") |
| #Some Notes: |
| i = input() |
| row += rounds[x] + ": " + "??" |
| print("Select an option:") |
| row = "" |
| print("You lost") |
| if i in rounds and i != "Name": |
| #all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
| rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| #id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
| print(row) |
| else: |
| while True: |
| i = i.title() |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| if result[r1][idx] > result[r2][idx]: |
| print(row) |
| if result[r1][idx] == result[r2][idx]: |
| r2 = random.randint(0,29) |
| idx = rounds.index(i) |
| #Column Names: |
| import random |
| row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| row = "" |
| r1 = random.randint(0,29) |
| print("It's a draw!") |
| from databaseConnect import runSQL |
| rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| for x in range(len(rounds)): |
| row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| for x in range(len(rounds)): |
|   row += rounds[x] + ": " + str(result[r2][x]) |
|     break |
|   print("You win!") |
| #Some Notes: |
|   i = input() |
|   row += rounds[x] + ": " + "??" |
| print("Select an option:") |
|   row = "" |
|   print("You lost") |
|   if i in rounds and i != "Name": |
| #all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
| rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| #id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
|   print(row) |
| else: |
| while True: |
|   i = i.title() |
| result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| if result[r1][idx] > result[r2][idx]: |
|   print(row) |
| if result[r1][idx] == result[r2][idx]: |
| r2 = random.randint(0,29) |
| idx = rounds.index(i) |
| #Column Names: |
| import random |
|   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
|   row = "" |
| r1 = random.randint(0,29) |
|   print("It's a draw!") |
| from databaseConnect import runSQL |
| rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| for x in range(len(rounds)): |
|   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| 1 | from databaseConnect import runSQL |
| 2 | import random |
| 3 | #Column Names: |
| 4 | #id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
| 5 |    |
| 6 | #Some Notes: |
| 7 | #all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
| 8 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
| 9 | r1 = random.randint(0,29) |
| 10 | r2 = random.randint(0,29) |
| 11 | rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| 12 | for x in range(len(rounds)): |
| 13 |   row = "" |
| 14 |   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| 15 |   row += rounds[x] + ": " + "??" |
| 16 |   print(row) |
| 17 | print("Select an option:") |
| 18 | while True: |
| 19 |   i = input() |
| 20 |   i = i.title() |
| 21 |   if i in rounds and i != "Name": |
| 22 |     break |
| 23 |      |
| 24 | rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
| 25 | for x in range(len(rounds)): |
| 26 |   row = "" |
| 27 |   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
| 28 |   row += rounds[x] + ": " + str(result[r2][x]) |
| 29 |   print(row) |
| 30 |    |
| 31 | idx = rounds.index(i) |
| 32 | if result[r1][idx] > result[r2][idx]: |
| 33 |   print("You win!") |
| 34 | if result[r1][idx] == result[r2][idx]: |
| 35 |   print("It's a draw!") |
| 36 | else: |
| 37 |   print("You lost") |
| print("Good Luck!") |
| 1 | print("Good Luck!") |